package com.pos.clothes.service.serviceImpl;

import com.pos.clothes.mapper.ClothesMapper;
import com.pos.clothes.pojo.Clothes;
import com.pos.clothes.service.ClothesService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class ClothesServiceImpl implements ClothesService {
    @Autowired
    private ClothesMapper mapper;
    @Override
    public Integer insertClothes(Clothes clothes) {
        return mapper.insertClothes(clothes);
    }

    @Override
    public Integer IsNothing(Clothes clothes) {
        List<Clothes> res = mapper.selectByIdAndName(clothes);
        if (res.isEmpty()){
            return 0;
        }else{
            return res.get(0).getIdclothes();
        }
    }

}
